home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Balloons.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  10.6 KB  |  409 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Balloons.a
  3. ;
  4. ;    Contains:    Balloon Help Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__BALLOONS__') = 'UNDEFINED' THEN
  21. __BALLOONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  30.     include 'Quickdraw.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33. ;        include 'QuickdrawText.a'                                    ;
  34.  
  35.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  36.     include 'Menus.a'
  37.     ENDIF
  38. ;        include 'Memory.a'                                            ;
  39.  
  40.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  41.     include 'TextEdit.a'
  42.     ENDIF
  43.  
  44.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  45.     include 'Errors.a'
  46.     ENDIF
  47.  
  48. hmBalloonHelpVersion            EQU        $0002                ; The real version of the Help Manager 
  49. kHMHelpMenuID                    EQU        -16490                ; Resource ID and menu ID of help menu 
  50. kHMAboutHelpItem                EQU        1                    ; help menu item number of About Balloon Help… 
  51. kHMShowBalloonsItem                EQU        3                    ; help menu item number of Show/Hide Balloons 
  52. kHMHelpID                        EQU        -5696                ; ID of various Help Mgr package resources (in Pack14 range) 
  53. kBalloonWDEFID                    EQU        126                    ; Resource ID of the WDEF proc used in standard balloons 
  54. ; Dialog item template type constant 
  55. helpItem                        EQU        1                    ; key value in DITL template that corresponds to the help item 
  56. ; Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  57. hmDefaultOptions                EQU        0                    ; default options for help manager resources 
  58. hmUseSubID                        EQU        1                    ; treat resID's in resources as subID's of driver base ID (for Desk Accessories) 
  59. hmAbsoluteCoords                EQU        2                    ; ignore window port origin and treat rectangles as absolute coords (local to window) 
  60.  
  61. hmSaveBitsNoWindow                EQU        4                    ; don't create a window, just blast bits on screen. No update event is generated 
  62. hmSaveBitsWindow                EQU        8                    ; create a window, but restore bits behind window when window goes away & generate update event 
  63. hmMatchInTitle                    EQU        16                    ; for hwin resources, match string anywhere in window title string 
  64. ; Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  65. kHMStringItem                    EQU        1                    ; pstring used in resource 
  66. kHMPictItem                        EQU        2                    ; 'PICT' ResID used in resource 
  67. kHMStringResItem                EQU        3                    ; 'STR#' ResID & index used in resource 
  68. kHMTEResItem                    EQU        6                    ; Styled Text Edit ResID used in resource ('TEXT' & 'styl') 
  69. kHMSTRResItem                    EQU        7                    ; 'STR ' ResID used in resource 
  70. kHMSkipItem                        EQU        256                    ; don't display a balloon 
  71. kHMCompareItem                    EQU        512                    ; Compare pstring in menu item w/ PString in resource item ('hmnu' only) 
  72. kHMNamedResourceItem            EQU        1024                ; Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) 
  73. kHMTrackCntlItem                EQU        2048                ; Reserved 
  74. ; Constants for hmmHelpType's when filling out HMMessageRecord 
  75. khmmString                        EQU        1                    ; help message contains a PString 
  76. khmmPict                        EQU        2                    ; help message contains a resource ID to a 'PICT' resource 
  77. khmmStringRes                    EQU        3                    ; help message contains a res ID & index to a 'STR#' resource 
  78. khmmTEHandle                    EQU        4                    ; help message contains a Text Edit handle 
  79. khmmPictHandle                    EQU        5                    ; help message contains a Picture handle 
  80. khmmTERes                        EQU        6                    ; help message contains a res ID to 'TEXT' & 'styl' resources 
  81. khmmSTRRes                        EQU        7                    ; help message contains a res ID to a 'STR ' resource 
  82. kHMEnabledItem                    EQU        0                    ; item is enabled, but not checked or control value = 0 
  83.  
  84. ; ResTypes for Styled TE Handles in Resources 
  85. kHMTETextResType                EQU        'TEXT'                ; Resource Type of text data for styled TE record w/o style info 
  86. kHMTEStyleResType                EQU        'styl'
  87.  
  88. kHMDisabledItem                    EQU        1                    ; item is disabled, grayed in menus or disabled in dialogs 
  89. kHMCheckedItem                    EQU        2                    ; item is enabled, and checked or control value = 1 
  90. kHMOtherItem                    EQU        3                    ; item is enabled, and control value > 1 
  91. ; Method parameters to pass to HMShowBalloon 
  92. kHMRegularWindow                EQU        0                    ; Create a regular window floating above all windows 
  93. kHMSaveBitsNoWindow                EQU        1                    ; Just save the bits and draw (for MDEF calls) 
  94. kHMSaveBitsWindow                EQU        2                    ; Regular window, save bits behind, AND generate update event 
  95.  
  96. ; Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages 
  97. kHMMenuResType                    EQU        'hmnu'                ; ResType of help resource for supporting menus 
  98. kHMDialogResType                EQU        'hdlg'                ; ResType of help resource for supporting dialogs 
  99. kHMWindListResType                EQU        'hwin'                ; ResType of help resource for supporting windows 
  100. kHMRectListResType                EQU        'hrct'                ; ResType of help resource for rectangles in windows 
  101. kHMOverrideResType                EQU        'hovr'                ; ResType of help resource for overriding system balloons 
  102. kHMFinderApplResType            EQU        'hfdr'
  103.  
  104. HMStringResType         RECORD    0
  105. hmmResID                 ds.w   1        ; offset: $0 (0)
  106. hmmIndex                 ds.w   1        ; offset: $2 (2)
  107. sizeof                     EQU *            ; size:   $4 (4)
  108.                         ENDR
  109.  
  110. ; typedef struct HMStringResType  HMStringResType
  111. HMMessageRecord         RECORD    0
  112. hmmHelpType                 ds.w   1        ; offset: $0 (0)
  113. hmmString                 ds.l   64        ; offset: $2 (2)
  114.                          ORG 2
  115. hmmPict                     ds.w   1        ; offset: $2 (2)
  116.                          ORG 2
  117. hmmTEHandle                 ds.l   1        ; offset: $2 (2)
  118.                          ORG 2
  119. hmmStringRes             ds     HMStringResType ; offset: $2 (2)
  120.                          ORG 2
  121. hmmPictRes                 ds.w   1        ; offset: $2 (2)
  122.                          ORG 2
  123. hmmPictHandle             ds.l   1        ; offset: $2 (2)
  124.                          ORG 2
  125. hmmTERes                 ds.w   1        ; offset: $2 (2)
  126.                          ORG 2
  127. hmmSTRRes                 ds.w   1        ; offset: $2 (2)
  128.                          ORG 258
  129. sizeof                     EQU *            ; size:   $102 (258)
  130.                         ENDR
  131.  
  132. ; typedef struct HMMessageRecord  HMMessageRecord
  133. ; typedef HMMessageRecord     *HMMessageRecPtr
  134. ;  Public Interfaces  
  135. ;
  136. ; pascal OSErr HMGetHelpMenuHandle(MenuRef *mh)
  137. ;
  138.     IF ¬ GENERATINGCFM THEN
  139.         Macro
  140.         _HMGetHelpMenuHandle
  141.             move.w    #$0200,d0
  142.             dc.w     $A830
  143.         EndM
  144.     ELSE
  145.         IMPORT_CFM_FUNCTION    HMGetHelpMenuHandle
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal OSErr HMShowBalloon(const HMMessageRecord *aHelpMsg, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, SInt16 theProc, SInt16 balloonVariant, SInt16 method)
  150. ;
  151.     IF ¬ GENERATINGCFM THEN
  152.         Macro
  153.         _HMShowBalloon
  154.             move.w    #$0B01,d0
  155.             dc.w     $A830
  156.         EndM
  157.     ELSE
  158.         IMPORT_CFM_FUNCTION    HMShowBalloon
  159.     ENDIF
  160.  
  161. ;
  162. ; pascal OSErr HMRemoveBalloon(void)
  163. ;
  164.     IF ¬ GENERATINGCFM THEN
  165.         Macro
  166.         _HMRemoveBalloon
  167.             move.w    #$0002,d0
  168.             dc.w     $A830
  169.         EndM
  170.     ELSE
  171.         IMPORT_CFM_FUNCTION    HMRemoveBalloon
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal Boolean HMGetBalloons(void)
  176. ;
  177.     IF ¬ GENERATINGCFM THEN
  178.         Macro
  179.         _HMGetBalloons
  180.             move.w    #$0003,d0
  181.             dc.w     $A830
  182.         EndM
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    HMGetBalloons
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal OSErr HMSetBalloons(Boolean flag)
  189. ;
  190.     IF ¬ GENERATINGCFM THEN
  191.         Macro
  192.         _HMSetBalloons
  193.             move.w    #$0104,d0
  194.             dc.w     $A830
  195.         EndM
  196.     ELSE
  197.         IMPORT_CFM_FUNCTION    HMSetBalloons
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal OSErr HMShowMenuBalloon(SInt16 itemNum, SInt16 itemMenuID, SInt32 itemFlags, SInt32 itemReserved, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, SInt16 theProc, SInt16 balloonVariant)
  202. ;
  203.     IF ¬ GENERATINGCFM THEN
  204.         Macro
  205.         _HMShowMenuBalloon
  206.             move.w    #$0E05,d0
  207.             dc.w     $A830
  208.         EndM
  209.     ELSE
  210.         IMPORT_CFM_FUNCTION    HMShowMenuBalloon
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal OSErr HMGetIndHelpMsg(ResType whichType, SInt16 whichResID, SInt16 whichMsg, SInt16 whichState, UInt32 *options, Point *tip, Rect *altRect, SInt16 *theProc, SInt16 *balloonVariant, HMMessageRecord *aHelpMsg, SInt16 *count)
  215. ;
  216.     IF ¬ GENERATINGCFM THEN
  217.         Macro
  218.         _HMGetIndHelpMsg
  219.             move.w    #$1306,d0
  220.             dc.w     $A830
  221.         EndM
  222.     ELSE
  223.         IMPORT_CFM_FUNCTION    HMGetIndHelpMsg
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal Boolean HMIsBalloon(void)
  228. ;
  229.     IF ¬ GENERATINGCFM THEN
  230.         Macro
  231.         _HMIsBalloon
  232.             move.w    #$0007,d0
  233.             dc.w     $A830
  234.         EndM
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION    HMIsBalloon
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal OSErr HMSetFont(SInt16 font)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         Macro
  244.         _HMSetFont
  245.             move.w    #$0108,d0
  246.             dc.w     $A830
  247.         EndM
  248.     ELSE
  249.         IMPORT_CFM_FUNCTION    HMSetFont
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal OSErr HMSetFontSize(UInt16 fontSize)
  254. ;
  255.     IF ¬ GENERATINGCFM THEN
  256.         Macro
  257.         _HMSetFontSize
  258.             move.w    #$0109,d0
  259.             dc.w     $A830
  260.         EndM
  261.     ELSE
  262.         IMPORT_CFM_FUNCTION    HMSetFontSize
  263.     ENDIF
  264.  
  265. ;
  266. ; pascal OSErr HMGetFont(SInt16 *font)
  267. ;
  268.     IF ¬ GENERATINGCFM THEN
  269.         Macro
  270.         _HMGetFont
  271.             move.w    #$020A,d0
  272.             dc.w     $A830
  273.         EndM
  274.     ELSE
  275.         IMPORT_CFM_FUNCTION    HMGetFont
  276.     ENDIF
  277.  
  278. ;
  279. ; pascal OSErr HMGetFontSize(UInt16 *fontSize)
  280. ;
  281.     IF ¬ GENERATINGCFM THEN
  282.         Macro
  283.         _HMGetFontSize
  284.             move.w    #$020B,d0
  285.             dc.w     $A830
  286.         EndM
  287.     ELSE
  288.         IMPORT_CFM_FUNCTION    HMGetFontSize
  289.     ENDIF
  290.  
  291. ;
  292. ; pascal OSErr HMSetDialogResID(SInt16 resID)
  293. ;
  294.     IF ¬ GENERATINGCFM THEN
  295.         Macro
  296.         _HMSetDialogResID
  297.             move.w    #$010C,d0
  298.             dc.w     $A830
  299.         EndM
  300.     ELSE
  301.         IMPORT_CFM_FUNCTION    HMSetDialogResID
  302.     ENDIF
  303.  
  304. ;
  305. ; pascal OSErr HMSetMenuResID(SInt16 menuID, SInt16 resID)
  306. ;
  307.     IF ¬ GENERATINGCFM THEN
  308.         Macro
  309.         _HMSetMenuResID
  310.             move.w    #$020D,d0
  311.             dc.w     $A830
  312.         EndM
  313.     ELSE
  314.         IMPORT_CFM_FUNCTION    HMSetMenuResID
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal OSErr HMBalloonRect(const HMMessageRecord *aHelpMsg, Rect *coolRect)
  319. ;
  320.     IF ¬ GENERATINGCFM THEN
  321.         Macro
  322.         _HMBalloonRect
  323.             move.w    #$040E,d0
  324.             dc.w     $A830
  325.         EndM
  326.     ELSE
  327.         IMPORT_CFM_FUNCTION    HMBalloonRect
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal OSErr HMBalloonPict(const HMMessageRecord *aHelpMsg, PicHandle *coolPict)
  332. ;
  333.     IF ¬ GENERATINGCFM THEN
  334.         Macro
  335.         _HMBalloonPict
  336.             move.w    #$040F,d0
  337.             dc.w     $A830
  338.         EndM
  339.     ELSE
  340.         IMPORT_CFM_FUNCTION    HMBalloonPict
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal OSErr HMScanTemplateItems(SInt16 whichID, SInt16 whichResFile, ResType whichType)
  345. ;
  346.     IF ¬ GENERATINGCFM THEN
  347.         Macro
  348.         _HMScanTemplateItems
  349.             move.w    #$0410,d0
  350.             dc.w     $A830
  351.         EndM
  352.     ELSE
  353.         IMPORT_CFM_FUNCTION    HMScanTemplateItems
  354.     ENDIF
  355.  
  356. ;
  357. ; pascal OSErr HMExtractHelpMsg(ResType whichType, SInt16 whichResID, SInt16 whichMsg, SInt16 whichState, HMMessageRecord *aHelpMsg)
  358. ;
  359.     IF ¬ GENERATINGCFM THEN
  360.         Macro
  361.         _HMExtractHelpMsg
  362.             move.w    #$0711,d0
  363.             dc.w     $A830
  364.         EndM
  365.     ELSE
  366.         IMPORT_CFM_FUNCTION    HMExtractHelpMsg
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal OSErr HMGetDialogResID(SInt16 *resID)
  371. ;
  372.     IF ¬ GENERATINGCFM THEN
  373.         Macro
  374.         _HMGetDialogResID
  375.             move.w    #$0213,d0
  376.             dc.w     $A830
  377.         EndM
  378.     ELSE
  379.         IMPORT_CFM_FUNCTION    HMGetDialogResID
  380.     ENDIF
  381.  
  382. ;
  383. ; pascal OSErr HMGetMenuResID(SInt16 menuID, SInt16 *resID)
  384. ;
  385.     IF ¬ GENERATINGCFM THEN
  386.         Macro
  387.         _HMGetMenuResID
  388.             move.w    #$0314,d0
  389.             dc.w     $A830
  390.         EndM
  391.     ELSE
  392.         IMPORT_CFM_FUNCTION    HMGetMenuResID
  393.     ENDIF
  394.  
  395. ;
  396. ; pascal OSErr HMGetBalloonWindow(WindowRef *window)
  397. ;
  398.     IF ¬ GENERATINGCFM THEN
  399.         Macro
  400.         _HMGetBalloonWindow
  401.             move.w    #$0215,d0
  402.             dc.w     $A830
  403.         EndM
  404.     ELSE
  405.         IMPORT_CFM_FUNCTION    HMGetBalloonWindow
  406.     ENDIF
  407.  
  408.     ENDIF ; __BALLOONS__
  409.